<?php
require_once 'config.php';
setlocale(LC_ALL, 'nl_NL');
session_start();
if($_GET['tree'])
{
	$oSeason = Season::getInstance();
	var_dump_path($oSeason->getTree());
	exit;
}
else
{
	$oFrontRenderer = new FrontRenderer();
	$oFrontRenderer->setSubject($subject);
	
	$arguments = explode('?', $_SERVER['REQUEST_URI']);
	$arguments = strtolower($arguments[0]);
	$arguments = explode('/', $arguments);
	array_shift($arguments);
	$c = count($arguments);
	
	$subject = ucfirst($arguments[0]);
	
	$method = 'show'.$subject;
	
	$renderer = new FrontRenderer();
	
	if(method_exists($renderer, $method))
	{
		$renderer->$method();
	}
	else
	{
		$renderer->showIndex();
	}
}


function doSearch($keyword)
{
	$results = SearchResult::search($keyword);		
	$return = array('results' => $results);	
	return $return;
}